<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="/assets/js/jquery.min.js"></script>
<!-- <script type="text/javascript" src="/asstes/js/jq_validator.js"></script> -->
</head>
<body>
	hello mvc!新
	<div>
		<a href="/html/test.jsp">花</a>
	</div>

	<form>
		<tr>
			<td>名称:</td>
			<td><input class="txt" type="text" name="name" id="name1"
				value="">
		</tr>
		<tr>
			<td valign="top">年龄:</td>
			<td><input type="text" class="txt" id="age" name="age" value=""></td>
		</tr>
		<tr>
			<td>出生日期:</td>
			<td><input type="text" class="txt" id="birthday" name="birthday"
				value=""></td>
		</tr>
		<tr>
			<td></td>
			<td><input type="button" value="提交" onclick="doSubmit()"></td>
		</tr>
	</form>
	<div>
			<input type="button" value="删除" onclick="remove2()">
	</div>
	<script type="text/javascript">
		function doSubmit() {
			var name = $('#name1').val();
			var birthday = $('#birthday').val();
			var age = $('#age').val();
			var dog = {
				name : name,
				birthday : birthday,
				age : age,
			}
			console.info(dog);
			$.ajax({
				url : '/dog/add',
				dataType : 'json',
				data : dog,
				type : 'get',
				 beforeSend : function() {
					console.info("正在提交");
				}, 
			})

		}
		function remove2() {
			$.ajax({
				url : '/dog/remove'+'/'+2,
				dataType : 'json',
				
				type : 'get',
				 beforeSend : function() {
					console.info("正在提交");
				}, 
			})
		}
	</script>
</body>
</html>